<%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<t:wrapper title="Register User">
	<jsp:body>
	<div id="navigation">
			<a href="javascript:history.back()" >&laquo; <spring:message code="content.general.back" /></a>
		</div>
		<p><spring:message code="register_user.body.description"/></p>
		<form method="post" action="<c:url value="/modify_user"/>" id="register-user">
		
			<input type="hidden" name="userId" value="${_user.id}"/>
		
			<label><spring:message code="register_user.first_name"/></label>
				<input type="text" name="first_name" value="${_user.firstName}"/>
				
			<label><spring:message code="register_user.last_name"/></label>
				<input type="text" name="last_name" value="${_user.lastName}"/>
			
			<label><spring:message code="register_user.phone_number"/></label>
				<input type="text" name="phone_number" value="${_user.phoneNumber}"/>
			
			<label><spring:message code="register_user.country"/></label>
				<input type="text" name="country" value="${_user.country}"/>
			
			<label><spring:message code="register_user.city"/></label>
				<input type="text" name="city" value="${_user.city}"/>
			
			<label><spring:message code="register_user.street"/></label>
				<input type="text" name="street" value="${_user.street}"/>
			
			<label><spring:message code="modify_user.role"/></label>
				<select name="role">
					<c:forEach items="${roles}" var="role">
						<option>
							<c:out value="${role}" />
						</option>
					</c:forEach>
				</select>
				
				
			<label><spring:message code="register_user.house_number"/></label>
				<input type="number" name="house_number" value="${_user.houseNumber}"/>
			
			<label><spring:message code="register_user.postal"/></label>
				<input type="text" name="postal" value="${_user.postal}"/>
			
			<label></label><button type="submit" onclick='this.form.action="disable_user"'>
				<c:choose>
					<c:when test="${!_user.disabled}">
						<spring:message code="modify_user.disable"/>
					</c:when>
					<c:otherwise>
						<spring:message code="modify_user.enable"/>
					</c:otherwise>
				</c:choose>
			</button>
			
			<label></label><button type="submit">
				<spring:message code="register_user.submit"/>
			</button>
			 
		</form>
	</jsp:body>
</t:wrapper>